package com.funtonow.jqdk.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.funtonow.jqdk.R;
import com.funtonow.jqdk.bean.GameThirdInfoListBean;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;

/**
 * @author Jiajien
 * @date 2019/6/28
 */
public class HotRecommedAdapter extends BaseQuickAdapter<GameThirdInfoListBean, BaseViewHolder> {

    public HotRecommedAdapter() {
        super(R.layout.item_recommend_layout);
    }

    @Override
    protected void convert(BaseViewHolder helper, GameThirdInfoListBean item) {
        BigDecimal money = new BigDecimal(item.getEdumax());
        NumberFormat format = new DecimalFormat("###,###");
        helper.setText(R.id.tv_hot_loan_name, item.getName())
                .setText(R.id.tv_max_money, String.format(Locale.getDefault(),
                        "最高可借(元)%s", format.format(money)));
    }


}
